package com.eightbears.beboy.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.eightbears.beboy.R;
import com.eightbears.beboy.ui.user.fragment.OrderFragmentFactory;

/**
 * Created by Administrator on 2017/7/1.
 */

public class OrderListViewPagerAdapter extends FragmentStatePagerAdapter {

    private final String[] mTabNames;

    public OrderListViewPagerAdapter(Context context, FragmentManager fm) {
        super(fm);
        mTabNames = context.getResources().getStringArray(R.array.tab_name);
    }

    @Override
    public Fragment getItem(int position) {
        return OrderFragmentFactory.createFragment(position);
    }

    @Override
    public int getCount() {
        return mTabNames.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTabNames[position];
    }
}
